package com.quanyan.ic.constants;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author dongsheng.lin
 * @date 2017/6/211:06
 */
public class RedisConstant {

    /**
     * 场地灯光情况key
     */
    public static String getSiteLightStatusKey(int siteId) {
        return "place:light:light:status:" + siteId;
    }

    /**
     * 自动开关灯设置key
     */
    public static String getPlaceLightSettingKey(int placeId) {
        return "place:light:icsetting:" + placeId;
    }

    public static String getClientSessionChannelKey(int placeId) {
        return "place:light:client:session:channel:placeId_" + placeId;
    }

    public static String getSiteTimeSegmentKey(int placeId, int siteId, long t) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
        String day_s = sdf.format(new Date(t));
        return "place:light:order:tSegment" + placeId + "_" + siteId + "_" + day_s;
    }
}
